Fix rx buffer allocation in netfront. The final allocation size
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 13 Dec 2005 02:47:47 +0000 (03:47 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 13 Dec 2005 02:47:47 +0000 (03:47 +0100)
was ending up bigger than PAGE_SIZE.

Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c

index 5fd59bc9f5fc51c9c00560c4c8d7cb380eadcf73..3115c5dafa630332dda31000c090cf96d2df9279 100644 (file)
@@ -540,8 +540,8 @@ static void network_alloc_rx_buffers(struct net_device *dev)
                 * tailroom then round down to SKB_DATA_ALIGN boundary.
                 */
                skb = alloc_xen_skb(
-                       (PAGE_SIZE - 16 - sizeof(struct skb_shared_info)) &
-                       (-SKB_DATA_ALIGN(1)));
+                       ((PAGE_SIZE - sizeof(struct skb_shared_info)) &
+                        (-SKB_DATA_ALIGN(1))) - 16);
                if (skb == NULL)
                        break;
                __skb_queue_tail(&np->rx_batch, skb);